-
Notifications
You must be signed in to change notification settings - Fork 21.2k
cmd, core, eth, triedb/pathdb: track node origins in the path database #32418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
fd1f3a2
to
51844b4
Compare
} | ||
} | ||
for _, addr := range deletes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply trie insert/update before deletions to avoid loading siblings of deleted nodes within fullNode.
} else { | ||
err = st.Update(tkey.Bytes(), val) | ||
err := st.Update(tkey.Bytes(), val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply trie insert/update before deletions to avoid loading siblings of deleted nodes within fullNode.
return err | ||
} | ||
// Short circuit if the origins are not tracked | ||
if len(s.nodeOrigin) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original values are not encoded into the journal if they are not provided.
51844b4
to
cbfa10d
Compare
cbfa10d
to
ca8006f
Compare
ca8006f
to
ada22c6
Compare
This PR is the first step in the trienode history series.
It introduces the
nodeWithOrigin
struct in the path database, which tracks the originalvalues of dirty nodes to support trienode history construction.
Note, the original value is always empty in this PR, so it won't break the existing journal
for encoding and decoding. But the compatibility of journal should be handled in the
following PR.